package br.com.alinesoftware.app.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.ForeignKey;

import com.powerlogic.jcompany.domain.validation.PlcUnifiedValidation;

@MappedSuperclass
@PlcUnifiedValidation
public abstract class Funcionario extends Pessoa implements Serializable {

	private static final long serialVersionUID = 2873178540142142638L;

	@ManyToOne(targetEntity = SetorEntity.class, fetch = FetchType.LAZY)
	@ForeignKey(name = "FK_FUNCIONARIO_SETOR")
	@NotNull
	@JoinColumn
	private Setor setor;

	@NotNull
	@Column(length = 5)
	private Boolean ativo;

	@NotNull
	@Column(length = 5)
	private Boolean permiteSolicitar;

	public Setor getSetor() {
		return setor;
	}

	public void setSetor(Setor setor) {
		this.setor = setor;
	}

	public Boolean getAtivo() {
		return ativo;
	}

	public void setAtivo(Boolean ativo) {
		this.ativo = ativo;
	}

	public Boolean getPermiteSolicitar() {
		return permiteSolicitar;
	}

	public void setPermiteSolicitar(Boolean permiteSolicitar) {
		this.permiteSolicitar = permiteSolicitar;
	}

}
